package com.sunrise.xdoc.entity.contact;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.sunrise.xdoc.entity.AbstractAuditEntity;

@MappedSuperclass
public abstract class AbstractContact extends AbstractAuditEntity {
	private static final long serialVersionUID = -3762262328040341408L;
	private String name;
	private String address;
	private String email;
	private String phone;
	private String fax;
	private String thongTin;

	@Column(name = "name", unique = true)
	@Length(max = 250)
	@NotBlank(message = "Chưa điền tên")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "address")
	@Length(max = 1024)
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "email")
	@Length(max = 128)
	@Email
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "phone")
	@Length(max = 20)
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "fax")
	@Length(max = 20)
	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	@Column(name = "thong_tin")
	@Length(max = 2048)
	public String getThongTin() {
		return thongTin;
	}

	public void setThongTin(String thongTin) {
		this.thongTin = thongTin;
	}
}
